1. Field of the Invention
The present invention relates to a compiling method, a compiling program, a compiling device and a compiling recording medium, more particularly to a technology for converting a source program described in an object-oriented language, a typical example of which is the C++ language, into an object code.
2. Description of the Related Art
A program size has been increasingly of a larger scale in the software development in recent years, in response to which an object-oriented language that can exert a high maintenance performance and can be effectively reutilized is attracting an attention. One of the features of the object-oriented language is to determine a method to be activated (code part in which a feature is described in the object-oriented language) in execution, which corresponds to a virtual function in the C++ language as a typical example of the object-oriented language.
In the case of mounting the feature of determining the method in the execution, in general, a method address storage table (table in which a leading address of each method is recorded) is statically generated in an outputted object code, and each class object references the method address storage table using a pointer for referencing the method address storage table corresponding to the relevant class (hereinafter, referred to as method address storage table pointer) and dynamically calls the methods determined in the execution using index values (hereinafter, referred to as index number) respectively determined for the methods so that the feature is realized.
Because the method address storage table is generated in the code as described, the outputted object code is enlarged as the table is increased in size. In order to control the increase of the outputted object code in size, the method address storage table must be generated in a non-redundant manner.
Describing a conventional compiling method, class name and input file name to which the respective methods determined in the execution belong are compared when the semantic analysis of a class declaration is executed. The entity and the declaration of the method address storage table are generated in the object code whey the class name and the input file name are coincident, while only the declaration of the method address storage table is generated in the object code when they fail to be coincident. The constitution of the conventional compiling method is recited in No. H06-266562 of the Publication of the Unexamined Japanese Patent Applications.
However, in the conventional compiling method, the redundant generation of the table is controlled through the comparison of the class name and the input file name, which can only contribute to the control of the redundant generation of the method address storage table with respect to the same classes in the respective input files, while failing to respond to redundant generation with respect to the different classes.